package com.duyan.learning;

public class SelectionSort {
	public static void sort(int a[]) {
		int current = 0;
		int smallest;
		int tmp;
		while (current < a.length) {
			int walker = current + 1;
			smallest = a[current];
			tmp = current;
			// System.out.println(smallest);
			System.out.println(walker);
			while (walker < a.length) {
				if (a[walker] < smallest) {
					smallest = a[walker];
					tmp = walker;
				}
				walker++;
			}
			System.out.println(tmp);
			a[tmp] = a[current];
			a[current] = smallest;

			System.out.println(current + "========================="
					+ a[current]);
			current++;
		}
	}
}
